<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2018/9/29
 * Time: 23:07
 */

include_once 'redis.php';

//获取请求数据
$uid = $_GET['uid'];

$userInfo = $redis->hGetAll("user:{$uid}");//获取用户信息

?>
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>编辑用户信息</title>
</head>
<body>
<form action="doEdit.php" method="post">
    <input name="uid" type="hidden" value="<?php echo $userInfo['uid'] ?>"/>
    <table border="1">
        <tr>
            <th colspan="2">
                <button style="float: left;" type="button" onclick="jump_url('main.php');">返回主页</button>
                编辑
            </th>
        </tr>
        <tr>
            <td>姓名</td>
            <td><input id="name" name="name" type="text" value="<?php echo $userInfo['name'] ?>" placeholder="姓名"/></td>
        </tr>
        <tr>
            <td>电话</td>
            <td><input id="phone" name="phone" type="text" value="<?php echo $userInfo['phone'] ?>" placeholder="电话"/>
            </td>
        </tr>
        <tr>
            <td>年龄</td>
            <td><input id="age" name="age" type="number" value="<?php echo $userInfo['age'] ?>" placeholder="年龄"/></td>
        </tr>
        <tr>
            <td colspan="2" align="center">
                <button type="submit">修改</button>
            </td>
        </tr>
    </table>
</form>
</body>
</html>
